package org.example.jccluboss.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 啊昌
 * @date 2025/4/16 18:38
 * MinioConfig 配置管理
 */
@Configuration
public class MinioConfig {
	/**
	 * minioUrl
	 */
	@Value("${minio.url}")
	private String url;

	/**
	 * minio账户
	 */
	@Value("${minio.accessKey}")
	private String accessKey;

	/**
	 * minio密码
	 */
	@Value("${minio.secretKey}")
	private String secretKey;

	/**
	 * 构造minioClient
	 */
	@Bean
	public MinioClient getMinioClient() {
		return MinioClient.builder().endpoint(url).credentials(accessKey, secretKey).build();
	}
}
